package cn.jiyun.user.mapper;

import cn.jiyun.user.pojo.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    //保存用户
    //@Insert("insert into users(nam,pwd,sex,birth) values(#{nam},#{pwd},#{sex},#{birth})")
    public void insertUser(Users users);

    //查询所有用户
    @Select("select * from users")
    public List<Users> findAll();

    //登录功能
    @Select("select * from users where nam=#{username} and pwd=#{password}")
    Users login(@Param("username") String username, @Param("password") String password);

    public void delete(Integer id);

    Users findById(Integer id);

    void update(Users users);
}
